import java.util.Scanner;

/**
 * Created with Intellij IDEA.
 * Description;
 * User:TQ02
 * Data:2023-10-25
 * Time:9:01
 * Text：洗牌
 */
public class Text1 {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int num=in.nextInt();
        for(int i=0;i<num;i++)
        {
            int left=in.nextInt();  //一手牌量
            int[][] array=new int[num][left*2];
            int k1=in.nextInt();    //洗牌次数
            int k=0;
            while(k<left*2){
                int num1=in.nextInt();
                array[i][k]=num1;
                k++;
            }

            for(int c=0;c<k1;c++){
                int[] array1=new int[left*2];
                int t1=left-1,t2=left*2-1;
                int a1=0;
                //洗牌中
                while(t1>=0){
                    array1[a1++]=array[i][t2];
                    array1[a1++]=array[i][t1];
                    t2--;
                    t1--;
                }
                int d=0;
                //数组逆序
                for(int b=left*2-1;b>=0;b--){
                    array[i][d++]=array1[b];
                }
            }
            for(int b=0;b<left*2;b++){
                System.out.print(array[i][b]+" ");
            }
            System.out.println();
        }

    }
}